<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<h2>All Outcomes</h2>
<table>
	<tr>
		<th>Id</th>
		<th>User Id</th>
		<th>Book Id</th>
		<th>Start date</th>
		<th>Return date</th>
		<th>Returned</th>
	</tr>
	<c:forEach var="record" items="${outcomes}">
		<tr>
			<td><c:out value="${record.id}" /></td>
			<td><c:out value="${record.user.id}" /></td>
			<td><c:out value="${record.book.id}" /></td>
			<fmt:formatDate value="${record.startDate}" var="startDate" pattern="dd/MM/yyyy" />
			<td><c:out value="${startDate}" /></td>
			<fmt:formatDate value="${record.returnDate}" var="returnDate" pattern="dd/MM/yyyy" />
			<td><c:out value="${returnDate}" /></td>
			<td><c:if test="${record.incomeRecord!=null}">
					+
				</c:if></td>
			<td>
			 <a href='<spring:url value="/admin/delete_outcome?id=${record.id}" htmlEscape="true" />'>Delete</a>
			</td>	
		</tr>
	</c:forEach>
</table>

